<template>
    <div>
        <div class="push-login-mid" v-loading='showLoading'>
            
        </div>
    </div>
</template>
<script>
import { loginByAccount } from '@/api/api'
export default {
    data(){
        return{
            showLoading:true,
        }
    },
    created(){
        window.ejectRelevantPages = this.ejectRelevantPages
    },
    methods:{
        // 大屏跳转过来模拟登陆
        ejectRelevantPages(item1,item2,item3){
            // item1为大屏传递过来的模块（自己设置的）
            // item3表示传递过来的参数
            let _this = this
            let getName = eval('(' + item3 + ')')
            localStorage.setItem("isClient",getName.getName)
            let parames = {
                accountName:getName.getName,
                loginId: getName.loginId,
            }
            loginByAccount(parames).then((res)=>{
                if(res.status == 200){
                    // 模拟登陆
                    _this.$store.commit('setUserInfor', JSON.stringify(res.data));
                    // 可以从此处判断模块设置跳转的路径
                    _this.$router.push({ path: '/resetAlarm',query:{getData:item3} });
                }
            })
        },
    }
}
</script>
<style scoped>
    .push-login-mid{
        height: 100vh;
    }
</style>